<?php

namespace app\modules\user\services;

use app\common\services\BaseService;
use app\models\User;

class HomeService extends BaseService{

    /**
     * 获取登陆者信息
     * @return array
     * @throws \yii\base\InvalidConfigException
     */
    public static function userInfo(){
        /**
         * @var User $user
         */
        $user = \Yii::$app->getModule("user")->get("user")->getIdentity();
        return [
            'username'=>$user->username,
            'thumbnail'=>$user->thumbnail,
            'mobile'=>$user->mobile,
            'service_mobile'=>\Yii::$app->params['service_mobile'],
        ];
    }
}